package com.example.dbmysql.mapper;


import com.example.dbmysql.pojo.NowStay;
import com.example.dbmysql.pojo.RoomHistory;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface NowStayMapper {


    @Insert("insert into nowStay(guest_name,phone,card_num,stay_time,departure_time,roomName,status,roomid)"+
            "values(#{guestName},#{phone},#{cardNum},#{stayTime},#{departureTime},#{roomName},#{status},#{roomId})")
    void NewRecording(NowStay nowStay);

    @Select("select * from nowStay where roomid=#{roomId} ")
    NowStay selectByRoomId(int roomId);

    @Update("update nowStay set departure_time=#{departureTime}")
    void updateTime(String departureTime);

    @Update("update  nowStay set roomName=#{roomName}")
    void updateRoomName(String roomName);

    @Select("select * from nowStay")
    List<NowStay> selectAll();
}
